﻿using voidbox;
using System;
using System.Collections.Generic;
using System.Numerics;
using System.Text;

namespace voidbox
{
    public struct PackedTextureElement
    {

        public ushort index; // 未分配索引


        public Vector2I sizeTL; // 最常见的值 (-8,-8)
        public Vector2I sizeRB; // 最常见的值 (8,8) //这样就能构成一个 中心定位的16x16的元素
        public Vector2 uvCenter; // UV中心
        public Vector2 uvHalfSize; // UV半径
        public byte uvLayer;
        public SpriteEffect eff;

        public fAABB UV
        {
            get
            {
                return new fAABB(uvCenter.X - uvHalfSize.X, uvCenter.Y - uvHalfSize.Y, uvCenter.X + uvHalfSize.X, uvCenter.Y + uvHalfSize.Y);
            }
        }
        public int PixelWidth
        {
            get
            {
                return -sizeTL.X + sizeRB.X;
            }
        }
        public int PixelHeight
        {
            get
            {
                return -sizeTL.Y + sizeRB.Y;
            }
        }
    }
}
